<#include "../common/_layout.html"/> <@head title="微信菜单管理">
<style type="text/css">
.cll {
	background-color: #ddd;
}
</style>
</@head> <@layout menu='/wechatmenu'>
<!-- Content Header (Page header) -->
<section class="content-header">
	<h1>舟山汇智智能科技有限公司</h1>
	<ol class="breadcrumb">
		<li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
		<li><a href="#">lte</a></li>
		<li class="active">prj</li>
	</ol>
</section>

<!-- Main content -->
<section class="content">
	<div class="row">
		<div class="col-xs-12">
			<div class="box">
				<form action="${ctx}/wechatmenu" id="listForm" method="post" role="form">
					<input type="hidden" id="id" name="id" value="${id!}">
					<input type="hidden" id="errcode" name="errcode" value="${errcode!}">
					<div class="box-header">
						<h3 class="box-title">微信菜单管理</h3>
						<div class="box-tools">
							<div class="input-group" style="width: 300px;">
								<input type="text" name="menuName" id="menuName"
									class="form-control input-sm pull-right" placeholder="根据菜单名称查询" value="${menuName!}">
								<div class="input-group-btn">
									<button class="btn btn-sm btn-default">
										<i class="fa fa-search"></i>
									</button>
								</div>
							</div>
						</div>
					</div>
					<!-- /.box-header -->
					<div class="box-body table-responsive no-padding">
						<button type="button" class="btn btn-default"
							onclick="location.href='${ctx}/wechatmenu/edit?wxid=${id}'">新增</button>
						<button type="button" id="deleteButton" disabled="disabled"
							class="btn btn-default" onclick="deleteAll('${ctx}/wechatmenu/delete')">删除
						</button>
						<button type="button" class="btn btn-default"
								onclick="location.href='${ctx}/wechatmenu/create?wxid=${id}'">创建</button>
						<table class="table table-hover">
							<tr class="info">
								<th title=""><input type="checkbox" id="allCheck"></th>
								<th title="微信ID">微信ID</th>
								<th title="菜单名称">菜单名称</th>
								<th title="父节点">父节点</th>
								<th title="类型">类型</th>
								<th title="菜单链接">菜单链接</th>
								<th title="菜单Key">菜单Key</th>
								<th title="顺序号">顺序号</th>
								<th title="状态">状态</th>
								<th>编辑</th>
							</tr>
							<#list page.getList() as item>
							<tr>
								<td><input type="checkbox" name="ids" value="${item.id!}"></td>
								<td>${item.wechat_info_id!}</td>
								<td>${item.title!}</td>
								<td>${WechatMenuMap.get(item.pid!)}</td>
								<td>
									<#if item.type??&&item.type.equals("click")>发送消息</#if>
									<#if item.type??&&item.type.equals("view")>跳转网页</#if>
									<#if item.type??&&item.type.equals("miniprogram")>小程序</#if>
								</td>
								<td>${item.linkurl!}</td>
								<td>${item.key!}</td>
								<td>${item.sort!}</td>
								<td>${item.status!}</td>
								<td>
									<button type="button" class="btn btn-info"
										onclick="location.href='${ctx}/wechatmenu/edit?id=${item.id}&wxid=${id}'">编辑
									</button>
								</td>
							</tr>
							</#list>
						</table>
						<#if (page.list?size>0)> <#include "../common/pager.html"> </#if>
					</div>
				</form>

			</div>
		</div>
	</div>
	<div class="row">
		<div class="col-xs-12">
			<button type="submit" class="btn btn-cancle"
				onclick="location.href='${ctx}/wechatinfo'">返回</button>
		</div>
	</div>
</section>
</@layout> <@scripts>
<script type="text/javascript"
	src="${ctx}/adminlte/plugins/bootbox/bootbox.min.js"></script>
<script type="text/javascript" src="${ctx}/js/list.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
        if($('#errcode').val()!="0"&&$('#errcode').val()!=null && $('#errcode').val()!=""){
            alert("发生错误,创建失败！错误代码："+$('#errcode').val());
            document.getElementById("errcode").value= null;
        }else if($('#errcode').val()=="0"){
            alert("创建成功！");
            document.getElementById("errcode").value= null;
		}
	});
</script>
</@scripts>
